WOLF core
WOLF: A Modular Estimation Framework for Robotics
XXXXXXXXXXXXXXXXXXXXXXXXvoid(0)" frameborder="0" name="MSearchResults" id="MSearchResults">
wolf::Composite< T > Class Template Reference

Map of state keys (char) to objects of type T (vectors, matrices, types, priors, ...) More...

#include <core/composite/composite.h>

Inheritance diagram for wolf::Composite< T >:
[legend]

Public Types

using CompositeType = T
 Type of the stored values. More...
 

Public Member Functions

 Composite (const YAML::Node &_n, const std::string &_field, const bool _required, const std::string &_keys=ALL_KEYS)
 Constructor from a YAML map of keys. More...
 
virtual ~Composite ()=default
 Destructor. More...
 
bool has (char _key) const
 Returns whether the composite has a key. More...
 
bool has (const StateKeys &_structure) const
 Returns whether the composite has all the keys. More...
 
StateKeys getKeys () const
 Returns all the keys. More...
 
Composite operator() (const std::string &_keys) const
 Returns the composite of the given keys. Throws if any is missing. More...
 
YAML::Node toYaml () const
 Returns a YAML map of the keys. More...
 

Friends

std::ostream & operator<< (std::ostream &_os, const Composite< T > &_x)
 Prints the composite to a stream. More...
 

Detailed Description

template<typename T>
class wolf::Composite< T >

Map of state keys (char) to objects of type T (vectors, matrices, types, priors, ...)

Member Typedef Documentation

◆ CompositeType

template<typename T >
using wolf::Composite< T >::CompositeType = T

Type of the stored values.

Constructor & Destructor Documentation

◆ Composite()

template<typename T >
wolf::Composite< T >::Composite ( const YAML::Node &  _n,
const std::string &  _field,
const bool  _required,
const std::string &  _keys = ALL_KEYS 
)
inline

Constructor from a YAML map of keys.

Parameters
_fieldfield of each key to read (the whole node of each key if empty)
_requiredthrow if a key (or its field) is missing
_keyskeys to read (all if ALL_KEYS)

◆ ~Composite()

template<typename T >
virtual wolf::Composite< T >::~Composite ( )
virtualdefault

Destructor.

Member Function Documentation

◆ getKeys()

template<typename T >
StateKeys wolf::Composite< T >::getKeys
inline

Returns all the keys.

◆ has() [1/2]

template<typename T >
bool wolf::Composite< T >::has ( char  _key) const
inline

Returns whether the composite has a key.

◆ has() [2/2]

template<typename T >
bool wolf::Composite< T >::has ( const StateKeys &  _structure) const
inline

Returns whether the composite has all the keys.

◆ operator()()

template<typename T >
Composite< T > wolf::Composite< T >::operator() ( const std::string &  _keys) const
inline

Returns the composite of the given keys. Throws if any is missing.

◆ toYaml()

template<typename T >
YAML::Node wolf::Composite< T >::toYaml
inline

Returns a YAML map of the keys.

Friends And Related Function Documentation

◆ operator<<

template<typename T >
std::ostream & operator<< ( std::ostream &  _os,
const Composite< T > &  _x 
)
friend

Prints the composite to a stream.


The documentation for this class was generated from the following file: